DEVTYPE

Syntax: DEVTYPE [(#channel)]
Location: SMS

This function returns a value to indicate the type of device the specified channel (default #0) is connected to.

Only look at the first three bits of the returned value:

x%=DEVTYPE(#channel)
x%=x% && 3

The value returned is:

0 - a purely serial device
1 - a screen device
2 - a file system device (ie. it supports file positioning)

Any other values indicate that there is something wrong with the channel (if the value is >2) otherwise, a negative value means that the channel is not open.

CROSS-REFERENCE:
OPEN, OPEN_IN, OPEN_NEW and OPEN_OVER allow you to open channels.
